package cn.edu.cqut.test3;

import com.sun.org.apache.xpath.internal.SourceTree;

import javax.sql.rowset.RowSetWarning;

public class Land
{
    public static void main(String[] args) {
     village.setWaterAmount(200);
     int leftWater=village.WaterAmount;
        System.out.println("水井中有"+leftWater+"升水");
        village ZhaoZhuang,MaJiaHeZhi;
        ZhaoZhuang=new village("赵庄");
        MaJiaHeZhi=new village("马家河子");
        ZhaoZhuang.setPeopleNumber(80);
        MaJiaHeZhi.setPeopleNumber(120);
        ZhaoZhuang.drinkWater(50);
      leftWater=MaJiaHeZhi.lookWaterAmount();
      String name=MaJiaHeZhi.name;
        System.out.println(name+"发现水井中有"+leftWater+"升水");
        MaJiaHeZhi.drinkWater(100);
        leftWater=ZhaoZhuang.lookWaterAmount();
        name=ZhaoZhuang.name;
        System.out.println(name+"发现水井中有"+leftWater+"升水");
        int PeopleNumber=ZhaoZhuang.getPeopleNumber();
        System.out.println("赵庄的人口："+PeopleNumber);
        PeopleNumber=MaJiaHeZhi.peopleNumber;
        System.out.println("马家河子的人口"+PeopleNumber);




    }
}
